<?php

/*
 * This file is part of the prestaBreadcrumb package.
 * (c) Julien Fusco <jfusco@prestaconcept.net>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */


/**
 * base prestaBreadcrumb components
 * 
 * @author	Julien Fusco <jfusco@prestaconcept.net>
 * @version	SVN: $Id: $ 1.0 - 7 déc. 2009 - Julien Fusco <jfusco@prestaconcept.net>
 * @since	7 déc. 2009 - Julien Fusco <jfusco@prestaconcept.net>
 */
class BaseprestaBreadcrumbComponents extends sfComponents
{
	public function executeShow()
	{
		$oprestaBreadcrumb = prestaBreadcrumb::getInstance();
		
		// If the breadcrumb has no item (except root), we try
		// to load the module config/breadcrumb.yml 
		if ($oprestaBreadcrumb->countItems() == 1)
		{
			if ($file = $this->getContext()->getConfigCache()->checkConfig('modules/'.$this->getContext()->getModuleName() . '/config/breadcrumb.yml', true))
			{
				require($file);
			}
		}
		
		$this->oprestaBreadcrumb = $oprestaBreadcrumb;
	}
}
